package com.plum.admin.common.strategy.data;

import com.google.common.collect.Lists;
import com.plum.admin.common.enums.DataScopeTypeEnum;
import com.plum.admin.common.util.SecurityUtil;
import com.plum.admin.modules.sys.dto.RoleDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * TODO
 *
 * @author 子丶沫
 * @version 1.0
 * @date 2021/9/1 16:58
 */
@Component("2")
public class ThisLevelDataScope implements AbstractDataScopeHandler {
    @Autowired
    private SecurityUtil securityUtil;
    @Override
    public List<String> getDeptIdList(RoleDTO roleDTO, DataScopeTypeEnum scopeTypeEnum) {
        String deptId = securityUtil.getUser().getDeptId();
        return Lists.newArrayList(deptId);
    }
}
